// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   TheClient.java

package org.quickserver.net.server;

import java.net.Socket;
import java.nio.channels.SocketChannel;

// Referenced classes of package org.quickserver.net.server:
//            ClientEvent, Authenticator, ClientAuthenticationHandler, ClientEventHandler, 
//            ClientExtendedEventHandler, ClientCommandHandler, ClientObjectHandler, ClientBinaryHandler, 
//            QuickServer, ClientData, ClientWriteHandler

public class TheClient
{

    public TheClient()
    {
        trusted = false;
        communicationLogging = true;
        event = ClientEvent.RUN_BLOCKING;
    }

    public void setServer(QuickServer server)
    {
        quickServer = server;
    }

    public QuickServer getServer()
    {
        return quickServer;
    }

    public void setSocket(Socket socket)
    {
        this.socket = socket;
    }

    public Socket getSocket()
    {
        return socket;
    }

    /**
     * @deprecated Method setAuthenticator is deprecated
     */

    public void setAuthenticator(Authenticator authenticator)
    {
        this.authenticator = authenticator;
    }

    /**
     * @deprecated Method getAuthenticator is deprecated
     */

    public Authenticator getAuthenticator()
    {
        return authenticator;
    }

    public void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler)
    {
        this.clientAuthenticationHandler = clientAuthenticationHandler;
    }

    public ClientAuthenticationHandler getClientAuthenticationHandler()
    {
        return clientAuthenticationHandler;
    }

    public void setClientData(ClientData data)
    {
        clientData = data;
    }

    public ClientData getClientData()
    {
        return clientData;
    }

    public void setMaxAuthTry(int authTry)
    {
        maxAuthTry = authTry;
    }

    public int getMaxAuthTry()
    {
        return maxAuthTry;
    }

    public void setMaxAuthTryMsg(String msg)
    {
        maxAuthTryMsg = msg;
    }

    public String getMaxAuthTryMsg()
    {
        return maxAuthTryMsg;
    }

    public void setTimeoutMsg(String msg)
    {
        timeoutMsg = msg;
    }

    public String getTimeoutMsg()
    {
        return timeoutMsg;
    }

    public void setClientEventHandler(ClientEventHandler handler)
    {
        eventHandler = handler;
    }

    public ClientEventHandler getClientEventHandler()
    {
        return eventHandler;
    }

    public void setClientExtendedEventHandler(ClientExtendedEventHandler handler)
    {
        extendedEventHandler = handler;
    }

    public ClientExtendedEventHandler getClientExtendedEventHandler()
    {
        return extendedEventHandler;
    }

    public void setClientCommandHandler(ClientCommandHandler handler)
    {
        commandHandler = handler;
    }

    public ClientCommandHandler getClientCommandHandler()
    {
        return commandHandler;
    }

    public void setClientObjectHandler(ClientObjectHandler handler)
    {
        objectHandler = handler;
    }

    public ClientObjectHandler getClientObjectHandler()
    {
        return objectHandler;
    }

    public boolean getTrusted()
    {
        return trusted;
    }

    public void setTrusted(boolean flag)
    {
        trusted = flag;
    }

    public void setCommunicationLogging(boolean communicationLogging)
    {
        this.communicationLogging = communicationLogging;
    }

    public boolean getCommunicationLogging()
    {
        return communicationLogging;
    }

    public void setClientBinaryHandler(ClientBinaryHandler handler)
    {
        binaryHandler = handler;
    }

    public ClientBinaryHandler getClientBinaryHandler()
    {
        return binaryHandler;
    }

    public void setTimeout(int time)
    {
        socketTimeout = time;
    }

    public int getTimeout()
    {
        return socketTimeout;
    }

    public void setClientEvent(ClientEvent event)
    {
        this.event = event;
    }

    public ClientEvent getClientEvent()
    {
        return event;
    }

    public void setMaxConnectionMsg(String msg)
    {
        maxConnectionMsg = msg;
    }

    public String getMaxConnectionMsg()
    {
        return maxConnectionMsg;
    }

    public void setSocketChannel(SocketChannel socketChannel)
    {
        this.socketChannel = socketChannel;
    }

    public SocketChannel getSocketChannel()
    {
        return socketChannel;
    }

    public void setClientWriteHandler(ClientWriteHandler handler)
    {
        writeHandler = handler;
    }

    public ClientWriteHandler getClientWriteHandler()
    {
        return writeHandler;
    }

    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("{TheClient ");
        if(socket != null)
            sb.append(socket);
        else
            sb.append("no socket");
        sb.append(", Event: ").append(event);
        sb.append('}');
        return sb.toString();
    }

    private String timeoutMsg;
    private String maxAuthTryMsg;
    private int maxAuthTry;
    private Socket socket;
    private Authenticator authenticator;
    private ClientAuthenticationHandler clientAuthenticationHandler;
    private ClientEventHandler eventHandler;
    private ClientExtendedEventHandler extendedEventHandler;
    private ClientCommandHandler commandHandler;
    private ClientObjectHandler objectHandler;
    private ClientBinaryHandler binaryHandler;
    private QuickServer quickServer;
    private ClientData clientData;
    private boolean trusted;
    private boolean communicationLogging;
    private int socketTimeout;
    private String maxConnectionMsg;
    private ClientEvent event;
    private SocketChannel socketChannel;
    private ClientWriteHandler writeHandler;
}
